Run the cell below to checkout the github project containing utility classes for connecting to Message Hub.

The cell compiles the github project and copies the resulting in jar files to a location where DSX is able to use them.

After running the cell below, ensure you restart your kernel.


In [8]:
%%bash

# stop immediately if an error is encountered
set -e

# check out the scala messagehub utility code
if [[ ! -d SparkMessageHubScala/ ]]
then
  git clone https://github.com/snowch/SparkMessageHubScala.git
fi

cd SparkMessageHubScala/

# retrieve the latest changes
git pull

# build the scala code and create a jar file
./gradlew -q clean shadowJar

# copy the jar files to a location where dsx can find them
cp -fv libs/messagehub.login-1.0.0.jar ${HOME}/data/libs/
cp -fv build/libs/SparkMessageHubScala-all.jar ${HOME}/data/libs/


Already up-to-date.
‘libs/messagehub.login-1.0.0.jar’ -> ‘/gpfs/fs01/user/sa4c-d959cc4450093e-39ca506ba762/data/libs/messagehub.login-1.0.0.jar’
‘build/libs/SparkMessageHubScala-all.jar’ -> ‘/gpfs/fs01/user/sa4c-d959cc4450093e-39ca506ba762/data/libs/SparkMessageHubScala-all.jar’

Now restart the kernel!!!